# 将外部库的头文件目录添加到包含路径，这样项目中的代码就能找到这些头文件
set(GOOGLE_TEST ${EXTERNAL_LIB_DIR}/googletest)
set(TEST_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/bin/tests)

include_directories(${GOOGLE_TEST}/googletest/include ${GOOGLE_TEST}/googlemock/include)
link_directories(${GOOGLE_TEST}/lib)

# 添加测试可执行文件
include_directories(../modules/character_module/include)
add_executable(my_tests test_character.cpp)

target_link_libraries(my_tests 
    character_module
    map_module
    gtest
    pthread
)
set_target_properties(my_tests PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${TEST_OUTPUT_DIR}
)
# 设置测试相关的 CMake 模块 
enable_testing()   #启用 CMake 的测试功能。






